package com.czxy.changgou3.com.czxy.changgou3.service;

import com.czxy.changgou3.com.czxy.changgou3.mapper.SpecificationMapper;
import com.czxy.changgou3.pojo.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zhangmengxiang1@itcast.cn
 * @version 1.0
 * @date 2020/4/22
 */
@Service
@Transactional
public class SpecificationService {

    @Resource
    private SpecificationMapper specificationMapper;

    /**
     * 查询指定分类的所有规格
     * @param categoryId
     * @return
     */
    public List<Specification> findAll(Integer categoryId ){
        // 查询
        List<Specification> list = this.specificationMapper.findAll(categoryId);
        // 封装
        return list;
    }
}
